package com.wxm.log.start.config;

import com.wxm.log.api.event.LogListener;
import com.wxm.log.start.service.LogService;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * <p>
 *      日志实现配置
 * </p>
 *
 * @author: wxm
 * @Date: 2021/10/5
 */
@Configuration
public class LogConfiguration {

    @Bean
    @ConditionalOnMissingBean
    public LogListener sysLogListener(LogService logService){
        return new LogListener(logService::saveLog);
    }
}
